﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoolERP_BLL;
using CoolERP_Entities;

namespace CoolERP_Web.User
{
    public partial class JCCDMX_JC_BZX : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                BindData();
        }

        private void BindData()
        {
            using (JCCDBLL xBLL = new JCCDBLL())
            {
                Dictionary<string, string> dc = new Dictionary<string, string>();
                dc.Add("ID", this.GetUrlParam("id").ToString());
                int RecordCount = 0;
                vJCCD entity = xBLL.GetJCCD(dc, "BH", null, 1, out RecordCount).FirstOrDefault();
                if (entity != null)
                {
                    liBH.Text = entity.BH;
                    liBMMC.Text = entity.BMMC;
                    liRYMC.Text = entity.RYMC;
                    liRQ.Text = entity.RQ.ToString("yyyy-MM-dd HH:mm");
                    liReason.Text = entity.JCCYY;
                    liBZ.Text = entity.BZ;
                    liZT.Text = Convert.ToInt32(entity.ZT) == 1 ? "已完成" : "未完成";
                    List<JCCDMXBModel> mxbs = xBLL.GetJCCDMXB(entity.ID, 3);
                    GridView1.DataSource = mxbs;
                    GridView1.DataBind();
                }
            }
        }
    }
}